package cn.dankal.flyaudio.home

import api.InfoServiceFactory
import cn.dankal.basiclib.base.fragment.BaseRecyclerViewFragment
import cn.dankal.basiclib.base.recyclerview.BaseRecyclerViewPresenter
import cn.dankal.basiclib.rx.AbstractStateSubscriber
import cn.dankal.business.pojo.BaseBeanList
import cn.dankal.business.pojo.InfoBean

class InformationPrsenter: BaseRecyclerViewPresenter<InfoBean>() {
    override fun requestData(pageIndex: String?) {
        InfoServiceFactory.info_list(pageIndex, BaseRecyclerViewFragment.PAGE_SIZE)
                .subscribe(object :
                        AbstractStateSubscriber<BaseBeanList<InfoBean>>(view) {
                    override fun onNext(t: BaseBeanList<InfoBean>) {
                        super.onNext(t)
                        this@InformationPrsenter.view.render(t.list)
                    }
                })
    }

}